﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;

using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace TestGenerator
{
    class Program
    {
        static int FileNameArg = 0;
        static int XNumber = 1;
        static int YNumber = 2;
        
        static int MaxRnd = 10000;

        static void Main(string[] args)
        {
            int X, Y;
            Random rnd = new Random();
            Debug.Assert(args[FileNameArg]!=null);
            Debug.Assert(args[XNumber] != null);
            Debug.Assert(args[YNumber] != null);

            StreamWriter sw = File.CreateText(args[FileNameArg]);

            sw.WriteLine(args[XNumber] + " " + args[YNumber]);

            X = int.Parse(args[XNumber]);
            Y = int.Parse(args[YNumber]);

            for (int i = 0; i < X; i++)
            {
                sw.WriteLine(Y.ToString());
                for (int j = 0; j < Y; j++)     
                    sw.WriteLine(rnd.Next(MaxRnd) + " " + j);              
            }
            sw.Flush();
        }
    }
}
